#include "MainScreenPanel.h"

#include "Core/GlobalContext.h"

#include <imgui_internal.h>

namespace SE
{
	void MainScreenPanel::onRender(const Double deltaMilliseconds)
	{
		RenderAPI::SetClearColor({ 0.4f, 0.3f, 0.2f, 1.0f });
		RenderAPI::Clear();

		ImGui::Begin("Main Screen Panel");

		auto windowSize = ImGui::GetContentRegionAvail();
		RenderAPI::GetBackground()->setBuffer(windowSize.x, windowSize.y);
		ImGui::Image(
			(void*)GlobalContext::GetRenderContext()->background->getAttachmentID(FrameBuffer::AttachmentType::Color),
			windowSize, { 0, 1 }, { 1, 0 });

		ImGui::End();
	}

	String MainScreenPanel::getName() const
	{
		return "Main Sreen Panel";
	}
} // !namespace SE